﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ProyectoVuelos.Presentacion.Contrato;
using ProyectoVuelos.Presentacion.Presentador;

namespace ProyectoVuelos.Presentacion.Vista
{
    public partial class ResultadoCompra : System.Web.UI.Page
    {

        #region Atributos
           PresentadorFactura _presentador;
        #endregion

        protected void Page_Load(object sender, EventArgs e)
        {
            this._presentador = new PresentadorFactura(this);
            int idFactura = (int) Session["idFactura"];
            this._presentador.ConsultarFactura(idFactura);
            this._presentador.ConsultarBoletos(idFactura);
        }

        #region Sets

        public void TextoNumeroFactura(string numeroFactura)
        {
            this.textoNumeroFactura.Text = numeroFactura;
        }
        public void TextoFechaFactura(string fechaFactura)
        {
            this.textoFechaFactura.Text = fechaFactura;
        }
        public void TextoMontoTotal(string montoTotal)
        {
            this.textoMontoTotal.Text = montoTotal;
        }
        public void GridDetallesFactura(GridView gridDetallesFactura)
        {
            this.gridDetalles = gridDetallesFactura;
        }
        public void GridBoletos(GridView gridBoletos)
        {
            this.gridBoletos = gridBoletos;
        }
        #endregion

        #region Gets
        public GridView GridDetallesFactura()
        {
            return this.gridDetalles;
        }

        public GridView GridBoletos()
        {
            return this.gridBoletos;
        }

        public string TextoNumeroFactura()
        {
            return this.textoNumeroFactura.Text;
        }

        public string TextoMontoTotal()
        {
            return this.textoMontoTotal.Text;
        }

        public string TextoFechaFactura()
        {
            return this.textoFechaFactura.Text;
        }


        #endregion

        protected void gridBoletos_RowCommand(object sender,GridViewCommandEventArgs e)
        {
            if (e.CommandName == "Examine")
            {
                // Retrieve the row index stored in the 
                // CommandArgument property.
               // int index = Convert.ToInt32(e.CommandArgument);

                // Retrieve the row that contains the button 
                // from the Rows collection.
                //GridViewRow row = GridView1.Rows[index];
                // Add code here to add the item to the shopping cart.
            }
        }
        /* #region Interfaz
        Label ContratoFactura.TextoNumeroFactura
        {
            get
            {
                return this.textoFechaFactura;
            }
            set
            {
                this.textoNumeroFactura = value;
            }
        }

        Label ContratoFactura.TextoFechaFactura
        {
            get
            {
                return this.textoFechaFactura;
            }
            set
            {
                this.textoFechaFactura = value;
            }
        }

         Label TextoMontoFactura
        {
            get
            {
                return this.textoMontoTotal;
            }
            set
            {
                this.textoMontoTotal = value;
            }
        }

         GridView GridDetalles
        {
            get
            {
                return this.gridDetalles;
            }
            set
            {
                this.gridDetalles = value;
            }
        }
        #endregion*/

        #region Eventos
        protected void Button1_Click(object sender, EventArgs e)
        {
            this._presentador.ConsultarFactura(65);
            this._presentador.ConsultarBoletos(65);
        }
        #endregion

        protected void gridDetalles_RowCommand(object sender,
      System.Web.UI.WebControls.GridViewCommandEventArgs e)
        {

            string currentCommand = e.CommandName;
            int currentRowIndex = Int32.Parse(e.CommandArgument.ToString());


            Label1.Text = "Command: " + currentCommand;
        }
      

        protected void gridDetalles_SelectedIndexChanged(object sender, EventArgs e)
        {
         
  
        }

        protected void Button2_Click(object sender, EventArgs e)
        {
            this._presentador.ConsultarBoletos(65);
        }

       
  

    


      

      

    }
}